﻿using Razor.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Razor.Controllers
{
    public class HomeController : Controller
    {
        Product myProduct = new Product
        {
            ProductID = 1,
            Name = "wang",
            Description="A boat for one person",
            Category="Watersports",
            Price = 234M
        };
        // GET: Home
        public ActionResult Index()
        {
            return View(myProduct);
        }
        public ActionResult NameAndPrice()
        {
            return View(myProduct);
        }
        public ActionResult DemoExpression()
        {
            ViewBag.ProductCount = 1;
            ViewBag.ExpressShip = true;
            ViewBag.ApplyDiscount = false;
            ViewBag.Supplier = null;
            return View(myProduct);
        }
        public  ActionResult DempArray()
        {
            Product[] array =
            {
                new Product {Name="Kayak",Price=345M },
                new Product {Name="Lifejacket",Price=45M },
                new Product {Name="Corner flag",Price=34M }
            };
            return View(array);
        }
    }
}